#include <SoftwareSerial.h>
#define LED 2
SoftwareSerial mySerial(9, 8); // RX, TX

void Show(){
  while(mySerial.available()){
    Serial.write(mySerial.read());
  }
}
void setup() {
  Serial.begin(115200);
  pinMode(LED, OUTPUT);
  mySerial.begin(115200);
  delay(1000);
  Serial.println("Goodnight  moon2");
  delay(1000);
  mySerial.println("AT+CIPSTART=\"TCP\",\"ip\",5000");
  delay(1000);
  mySerial.println("AT+CIPMODE=1");
  delay(1000);
  mySerial.println("AT+CIPSEND");
  delay(1000);
  Show();
}

void loop() {
  mySerial.println("GET /\r\n");
  char status;
  delay(500);
  while(mySerial.available()){
    status = mySerial.read();
  }
  if(status == '0') digitalWrite(LED, LOW);
  else digitalWrite(LED, HIGH);
}
